<?

function jsenc($s) {
  return addcslashes($s, "\\\'\"&\n\r<>");
}

function capitalize($s) {
  $splits = preg_split('/([ \-])/', strtolower($s), -1, PREG_SPLIT_DELIM_CAPTURE);
  $res = "";
  foreach ($splits as $split)
    if ($split !== "de" && $split !== "lui")
      $res .= ucfirst($split);
    else
      $res .= $split;
  return $res;
}

?>
